﻿namespace BacklogParser
{
    using BacklogParser.Parsers;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Xml.Linq;

    public class Program
    {
        public static string xmlPath = @"C:\Users\Filip\Desktop\Backlog\epregister_st36_99974173-99974275.xml";

        static void Main(string[] args)
        {
            using (var writer = new System.IO.StreamWriter("backlog.sql", false))
            {
                writer.Write("");
            }

            XDocument xdoc = XDocument.Load(xmlPath);


            var documents = xdoc.Descendants(Constants.Epo + "register-document").ToList();
            var result = new List<RegisterDocument>();
            foreach (var item in documents)
            {
                var parsed = DocumentParser.ParseDocument(item);
                result.Add(parsed);
                Console.WriteLine(parsed);
            }

            Console.WriteLine("Done");
        }
    }
}
